import http from '../index'

// 分页获取运输工具
export const getVehicles = ({ ascended = null, current = null, size = null, sortFieldName = null, status = null, vehicleCode = null, vehicleName = null }) => {
    return http.get("vehicles", { ascended, current, size, sortFieldName, status, vehicleCode, vehicleName })
}

// 获取所有运输工具
export const getVehiclesAll = () => {
    return http.get("vehicles/all")
}

// 根据sid获取运输工具
export const getVehicleDetail = ({ sid }) => {
    return http.get("vehicles/" + sid)
}

// 新增运输工具
export const addVehicle = ({ vehicleName, vehicleCode, note, status = null }) => {
    return http.post("vehicles", { vehicleName, vehicleCode, note, status })
}

// 修改运输工具
export const editVehicle = ({ sid, vehicleName, vehicleCode, note, status = null }) => {
    return http.put("vehicles/" + sid, { vehicleName, vehicleCode, note, status })
}

// 批量删除运输工具
export const delVehicles = ({ sidList }) => {
    return http.put("vehicles/delete", { sidList })
}

// 根据sid启用-停用运输工具
export const changeVehicleStatus = ({ sid }) => {
    return http.put("vehicles/" + sid + '/status')
}



